<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/competition-common :: common_head(${myLinks}, ${myScripts})">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>个人中心</title>
    <style>
        .profile-header {
            display: flex;
            align-items: center;
            gap: 20px;
        }
        .profile-pic {
            width: 100px;
            height: 100px;
            border-radius: 50%;
            overflow: hidden;
        }
        .profile-pic img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
    </style>
</head>
<body>
<div th:replace="common/competition-common::mall-header"></div>
<div th:replace="common/competition-common::competition-sidebar"></div>

<!-- 主内容区 -->
<div class="com-body">
    <div class="com-title">个人中心</div>
    <div class="com-card">
        <div class="profile-header">
            <div class="profile-pic">
                <img th:if="${user.uprofilepic != null and !user.uprofilepic.isEmpty()}" th:src="${user.uprofilepic}" alt="Profile picture" />
                <img th:unless="${user.uprofilepic != null and !user.uprofilepic.isEmpty()}" th:src="@{/image/default-avatar.png}" alt="Default Profile picture" />
            </div>
            <div>
                <h2 th:text="${user.uname}">用户名</h2>
                <p th:text="${user.id}">用户ID</p>
                <p th:text="${user.umail}">用户邮箱</p>
            </div>
        </div>
        <div class="modal-footer">
            <a th:href="@{/profile/modify}" class="btn btn-primary">修改信息</a>
            <a th:href="@{/logout}" class="btn btn-secondary">登出</a>
        </div>
    </div>
</div>
<div th:replace="common/competition-common::mall-footer"></div>
</body>
</html>
